import { User } from 'src/modules/system/user/entities/user.entity';
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, ManyToOne, OneToMany, ManyToMany, JoinTable } from 'typeorm';
import { Exebook } from 'src/modules/questionbank/exebook/entities/exebook.entity';
import { Trainingtask } from 'src/modules/trainingtask/entities/trainingtask.entity';

@Entity('duty')
export class Duty {
    @PrimaryGeneratedColumn('uuid')
    Id: string;
    @Column()
    Name: string; // 岗位名称
    @Column({default: 0})
    Deleted: number; // 删除标志，1为未删除，0为已删除
    @OneToMany(() => User, user => user.Duty)
    Users: User[]; // 公司下的用户列表

    @OneToMany(() => Exebook, exebook => exebook.Duty)
    Exebooks: Exebook[]; 

    @OneToMany(()=>Trainingtask, trainingtask=>trainingtask.duty)
    Trainingtask: Trainingtask[];
}
